﻿using Special_Item;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SeparateProjects
{
    public partial class Pro_User_Index : Form
    {
        public Pro_User_ChangePassword p1;
        public Pro_User_PersonalInformation p2;
        public Pro_User_ViewResults p3;
        public Pro_Admin_help p4;
        #region  构造参数传参
        /// <summary>
        /// 调用登录数据
        /// </summary>
        /// <param name="Accounts"></param>
        public Pro_User_Index(string Accounts)
        {
            InitializeComponent();
            lbl_Accounts.Text = Accounts;
        }
        #endregion
        #region  预加载事件
        /// <summary>
        /// 预加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Pro_User_Index_Load(object sender, EventArgs e)
        {
            p1 = new Pro_User_ChangePassword();
            p2 = new Pro_User_PersonalInformation(lbl_Accounts.Text);
            p3 = new Pro_User_ViewResults(lbl_Accounts.Text);
            p4 = new Pro_Admin_help();
        }
        #endregion
        #region  点击跳转更改密码
        /// <summary>
        /// 点击更改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// 
        private void User_ChangePassword_Click(object sender, EventArgs e)
        {
            Pro_User_ChangePassword p1 = new Pro_User_ChangePassword(lbl_Accounts.Text);
            p1.Show();
            p1.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(p1);
        }
        #endregion
        #region 点击跳转查看成绩
        /// <summary>
        /// 点击查看成绩
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void User_ViewResults_Click(object sender, EventArgs e)
        {
            Pro_User_ViewResults p3 = new Pro_User_ViewResults(lbl_Accounts.Text);
            p3.Show();
            p3.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(p3);
        }
        #endregion
        #region  点击跳转查看个人信息
        /// <summary>
        /// 点击跳转查看个人信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PersonalInformation_Click(object sender, EventArgs e)
        {
            Pro_User_PersonalInformation p2 = new Pro_User_PersonalInformation(lbl_Accounts.Text);
            p2.Show();
            p2.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(p2);
        }
        #endregion
        #region  点击退出程序
        /// <summary>
        /// 退出程序
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Quit_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确认退出", "提示信息",
                                               MessageBoxButtons.OKCancel,
                                               MessageBoxIcon.Information);
            if (dr.Equals(DialogResult.OK))
            {
                //退出程序
                Application.Exit();
            }
        }
        #endregion
        #region  帮助关于
        /// <summary>
        /// 帮助关于
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void About_Click(object sender, EventArgs e)
        {
            Pro_Admin_help p4 = new Pro_Admin_help();
            p4.Show();
            p4.TopLevel = false;
            Content.Controls.Clear();
            Content.Controls.Add(p4);
        }
        #endregion
        #region  点击字体颜色改变
        /// <summary>
        /// 点击字体颜色改变
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Account_Click(object sender, EventArgs e)
        {
            this.Account.ForeColor = Color.FromArgb(0,0,0);
        }
        /// <summary>
        /// 点击字体颜色改变
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void View_Click(object sender, EventArgs e)
        {
            this.View.ForeColor = Color.FromArgb(0,0,0);
        }
        /// <summary>
        /// 点击字体颜色改变
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Help_Click(object sender, EventArgs e)
        {
            this.Help.ForeColor = Color.FromArgb(0, 0, 0);
        }
        #endregion
        #region  鼠标移到上方改变字体
        private void Account_MouseHover(object sender, EventArgs e)
        {
            this.Account.ForeColor = Color.FromArgb(0, 0, 0);
            this.View.ForeColor = Color.White;
            this.Help.ForeColor = Color.White;
        }
        private void View_MouseHover(object sender, EventArgs e)
        {
            this.Account.ForeColor = Color.White;
            this.View.ForeColor = Color.FromArgb(0, 0, 0);
            this.Help.ForeColor = Color.White;
        }
        private void Help_MouseHover(object sender, EventArgs e)
        {
            this.Account.ForeColor = Color.White;
            this.View.ForeColor = Color.White;
            this.Help.ForeColor = Color.FromArgb(0, 0, 0);
        }
        #endregion
        #region 鼠标移开时的变化
        private void Account_MouseLeave(object sender, EventArgs e)
        {
            this.Account.ForeColor = Color.White;
        }
        private void View_MouseLeave(object sender, EventArgs e)
        {
            this.View.ForeColor = Color.White;
        }
        private void Help_MouseLeave(object sender, EventArgs e)
        {
            this.Help.ForeColor = Color.White;
        }
        #endregion
        

    }
}
